



import micropython
import esp


micropython.mem_info()
# stack: 1012 out of 14336
# GC: total: 64000, used: 11600, free: 52400, max new split: 98304
#  No. of 1-blocks: 252, 2-blocks: 34, max blk sz: 33, max free sz: 3265

print(
"\nstack_use=",micropython.stack_use(),
", flash_size=",esp.flash_size()
)


import uos
stat=uos.statvfs("/flash")
bsize=stat[0]
bfree=stat[3]
blocks=stat[2]

total=bsize*blocks
free=bsize*bfree


print("free=",free,"byte ","total=",total,"byte ")
print("free=",free/1024,"KB ","total=",total/1024,"KB ")
